'use strict';

const Controller = require('egg').Controller;

class BuyhouseController extends Controller {
    async index() {
        const {
            ctx
        } = this;
        ctx.body = 'hi, egg';
    }

    //经纪人详情
    async getHouse() {
        const {
            ctx
        } = this;
        const {
            value
        } = ctx.query;
        console.log(value, 'aa');
        let form = null;
        switch (value) {
            case '找商铺':
                form = 0;
                break;
            case '找写字楼':
                form = 1;
                break;
            case '找小区':
                form = 2;
                break;
        }
        console.log(form, 'form...');
        const data = await this.app.mysql.select('sellershouse', { wher: { form}});
        console.log(data,'data....');
        ctx.body = data;
    }
}

module.exports = BuyhouseController;